<?php

use app\components\BaseGridView;
use app\models\User;

?>

<?= \admin\widgets\AdminTabs::widget([
    'items' => User::$statusLabels,
    'id' => 'status'
]); ?>

<?= BaseGridView::widget([
    'dataProvider' => $dataProvider,
    'filterModel' => $searchModel,
    'columns' => [
        //['class' => 'yii\grid\SerialColumn'],
        //['class' => 'yii\grid\CheckboxColumn', 'headerOptions' => ['width' => '5%']],
        'id',
        ['attribute' => 'uname', 'label' => '企业名称'],
        'phone',
        ['label' => '行业', 'value' => function (User $model) {
            return $model->profile->industry;
        }],
        ['label' => '规模', 'value' => function (User $model) {
            return $model->profile->company_scale;
        }],
        ['label' => '信用代码', 'value' => function (User $model) {
            return $model->profile->company_code;
        }],
        ['label' => '状态', 'format' => 'raw', 'value' => function (User $model) {
            return $model->_statusLabel();
        }],
        'ctime:datetime',
        [
            'class' => 'app\components\BaseActionColumn',
            'template' => '{view}',
            'viewOptions' => ['title' => '查看', 'data-width' => 650],
        ],
    ],
]); ?>
